/**
 * Album
 */

 import consts from "../../../../../consts/consts";
 import storage from "../../../../../utils/storage";
 import Header from "../Header";
 import React,{Component}from "react";

 class Album extends Component{
    handleOnChangeAlbum(){
//        var root = this.props.root;
//        root.openDialog(consts.WIDGET_TYPE.ALBUM, true);
        consle.log("open dialog");
    }
    render(){
        const {type,data,selectedWidgetId,updateWidget,setState,selectContents} = this.props;
        let focus = ( data.widget_id == selectedWidgetId );
        return (
            <div ref="content" className={"content-item " + (focus ? "focus " : " ") + (data.visible ? "unfold " : "fold ")} onClick={() => selectContents(data)}>
                <Header type={type} data={data} updateWidget={updateWidget} setState={setState} />
                <div className="content">
                    <div>
                        <img src={data.url} />
                    </div>
                    <button onClick={() => this.handleOnChangeAlbum()}>{$._("Replace")}{$._("Picture")}</button>
                </div>
            </div>
        )
    }
 }

 module.exports = Album;
